<{include file="../common/header.tpl"}>
<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
        <{include file="../common/left.tpl"}>
    </td>
    <td width="87%" valign="top">

    <table width="100%" border="0" cellspacing="0">
      <tr>
            <td>
                 <div class="subnav">
                   <div class="content-menu ib-a blue line-x"> 
                     <a href="/webadmin/question/list"><em>问卷管理</em></a><span>|</span>
                       <a href="javascript:void(0);" class="on"><em><{if $info}>编辑问卷<{else}>添加问卷<{/if}></em></a>
                   </div>
                 </div>
                 <div class="pad_10">
                   <div class="table-list">
                        <div class="common-form">
                            <form name="myform" enctype="multipart/form-data" action="<{if $info}>/webadmin/question/doedit<{else}>/webadmin/question/doadd<{/if}>" method="post" id="myform">
                           <table width="100%" class="table_form contentWrap">
                              <tbody>
                                      <tr>
                                              <td width="80">问卷编号</td> 
                                              <td><input type="text" name="identifier"  value="<{$info.identifier}>" class="input-text" id="identifier"></td>
                                      </tr>
                                      <tr>
                                              <td width="80">问卷名称</td> 
                                              <td><input type="text" name="question_name" value="<{$info.question_name}>" class="input-text" id="question_name"></td>
                                      </tr>
                                      <tr>
                                              <td width="80">是否显示得分</td> 
                                              <td><input type="radio" name="show_score" <{if $info&&$info.show_score==1}>checked="checked"<{/if}> <{if !$info}>checked="checked"<{/if}> value="1" />是<input type="radio" name="show_score" value="0" <{if $info&&$info.show_score==0}>checked="checked"<{/if}> />否</td>
                                      </tr>
                                      <tr>
                                              <td width="80">所属项目</td> 
                                              <td>
                                                      <select name="project_id" autocomplete="off">
                                                              <option value="0">-请选择-</option>
                                                              <{foreach $project as $key=>$val}>
                                                              <option <{if $info.project_id eq $val.project_id}>selected="selected"<{/if}> value="<{$val.project_id}>"><{$val.project_name}></option>
                                                              <{/foreach}>
                                                      </select>
                                              </td>
                                      </tr>
                                      <tr>
                                          <td>上传客户网点</td>
                                          <td>
                                              <p>
                                                <span>
                                                    <input type="text" class="viewfile" id="viewfile" name="viewfile">
                                                </span>
                                                <label class="bottom" for="upload">查找文件</label><input type="file" class="file" onchange="document.getElementById('viewfile').value=this.value;" name="upfile" size="27">
                                                <a href="/webadmin/network/templateDown" class="button">网点导入模板下载</a>
                                            </p>
                                          </td>
                                      </tr>
                              </tbody>
                           </table>

                        <div class="bk15"></div>
                        <input name="question_id" type="hidden" value="<{$question_id}>"/>
                        <input name="dosubmit" type="submit" value="提交" class="button">
                        </form>
                        </div>
                   </div>
                 </div>
            </td>
      </tr>
    </table>
</td>
 </tr>
</table>
											
<script type="text/javascript">
	$(document).ready(function(){
		$('form[name="myform"]').submit(function(){
			var selectVal = $('select[name="project_id"]').val();
                        var identifier = $('#identifier').val();
                        var question_name = $('#question_name').val();
                        if (identifier == '') {
                            alert('问卷编号不能为空');
                            return false;
                        }
                        if (question_name == ''){
                            alert('问卷名称不能为空');
                            return false;
                        } 
			if(!parseInt(selectVal)){
				alert("请选择问卷所属项目");
				return false;
			}
			return true;
		});
	});
</script>
<{include file="../common/footer.tpl"}>